<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
/* div{
    width: 100px;
    height: 100px;
    background-color: black;
} */
</style>
<body>
    <!-- <button>点击切换颜色</button>
  
    <script>
document.querySelector('button').onclick=function(){
    var a=(Math.random()*255)
    var b=(Math.random()*255)
    var c=(Math.random()*255)
    var sum=document.body.style.backgroundColor='rgb('+a+','+b+','+c+')'
    console.log(sum)
} -->













<button>点击切换颜色</button><script>document.querySelector('button').onclick=function(){
var a=Math.random()*255
var b=Math.random()*255
var c=Math.random()*255
var sum=document.body.style.backgroundColor='rgb('+a+','+b+','+c+')'
console.log(sum)

}</script>
</script>


























    </script>
</body>
</html>